package mysql

import (
	_ "github.com/go-sql-driver/mysql"
	"github.com/go-xorm/xorm"
	"log"
)

var MysqlEngine *xorm.Engine

func init() {
	var err error
	MysqlEngine, err = xorm.NewEngine("mysql", "root:123456@tcp(192.168.1.40:3306)/sensor_main?charset=utf8")
	if err != nil {
		log.Fatal("mysql连接失败:", err)
	}
	MysqlEngine.SetMaxIdleConns(5)
	MysqlEngine.SetMaxOpenConns(20)
}
